/*
 * @Author: life 2145887855@qq.com
 * @Date: 2025-03-25 19:34:21
 * @LastEditors: life 2145887855@qq.com
 * @LastEditTime: 2025-04-08 22:00:10
 * @FilePath: \artist-platform-admin-master\src\api\td\teacher\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/config/axios'

// 教师 VO
export interface TeacherVO {
  id: number // 编号
  departId: number // 部门编号
  teacherNo: string // 工号
  password: string // 密码
  email: string // 邮箱
  realName: string // 真实姓名
  nickName: string // 艺名
  gender: number // 性别
  birthday: Date // 生日
  hiredate: Date // 入职时间
  title: number // 职称
  teacherState: number // 教师状态
  description: string // 个人介绍
}

// 教师 API
export const TeacherApi = {
  // 查询教师分页
  getTeacherPage: async (params: any) => {
    return await request.get({ url: `/td/teacher/page`, params })
  },

  // 查询教师详情
  getTeacher: async (id: number) => {
    return await request.get({ url: `/td/teacher/get?id=` + id })
  },

  // 新增教师
  createTeacher: async (data: TeacherVO) => {
    return await request.post({ url: `/td/teacher/create`, data })
  },

  // 修改教师
  updateTeacher: async (data: TeacherVO) => {
    return await request.put({ url: `/td/teacher/update`, data })
  },

  // 删除教师
  deleteTeacher: async (id: number) => {
    return await request.delete({ url: `/td/teacher/delete?id=` + id })
  },

  // 导出教师 Excel
  exportTeacher: async (params) => {
    return await request.download({ url: `/td/teacher/export-excel`, params })
  },

    // 下载教师模板 Excel
  exportTeacherTemplate: async () => {
    return await request.download({ url: `/td/teacher/export-excel-template` })
  },

  // 批量导入教师数据
  batchImportTeachers: async (formData: FormData) => {
    return await request.post({
      url: `/td/teacher/batch-import`,
      data: formData,
      headers: { 'Content-Type': 'multipart/form-data' },
    });
  },
}
export function exportTeacherTemplate() {
  throw new Error("Function not implemented.")
}

